package com.xf;

public class StringMethodImpl implements StringMethod{
    @Override
    public String turn_up(String s) {
        return s.toUpperCase();
    }

    @Override
    public String turn_low(String s) {
        return s.toLowerCase();
    }

    @Override
    public String reversal(String s) {
        return new StringBuilder(s).reverse().toString();
    }

    @Override
    public Integer count_num(String s,Character a) {
        Integer cnt=0;
        for(int i=0;i<s.length();i++){
            if(s.charAt(i)==a) cnt++;
        }
        return cnt;
    }
}
